cat > /etc/hosts <<EOF
127.0.0.1               localhost `curl http://169.254.169.254/latest/meta-data/local-hostname`
EOF

hostname  `curl http://169.254.169.254/latest/meta-data/local-hostname`

